﻿// (c) Andreas Kreisl 
// You are not permitted to use this in any way!

var class_TextLine_debug = false;


function class_TextLine(myFrame,vOffset,label) {
	this.size    = mod_sysmonitor_size;
	this.vOffset = vOffset;

	this.label = new Text();
	myFrame.appendChild(this.label);
	this.label.data = label;
	this.label.size = this.size;
	this.label.font = "Tahamo";
	this.label.style.fontWeight = "bold";
	this.label.color = "#FFFFFF";
	this.label.style.textAlign = "left"
	this.label.hOffset = 0;
	this.label.vOffset = this.vOffset + this.size;


	this.data = new Text();
	myFrame.appendChild(this.data);
	this.data.data = "";
	this.data.size = this.size;
	this.data.font = "Tahamo";
	this.data.style.fontWeight = "bold";
	this.data.color = "#FFFFFF";
	this.data.style.textAlign = "right"
	//this.data.hOffset = mod_sysmonitor_width;
	this.data.hOffset = this.label.width;
	this.data.vOffset = this.vOffset + this.size;
	this.data.width = mod_sysmonitor_width - this.label.width;


	this.watch("size", function (p_name,p_old,p_new) {
		this.label.size = p_new;
		this.label.vOffset = this.vOffset + p_new;

		this.data.size = p_new;
		this.data.vOffset = this.vOffset + p_new;

		//this.data.hOffset = mod_sysmonitor_width;
		this.data.hOffset = this.label.width;
		this.data.width = mod_sysmonitor_width - this.label.width;

		return p_new;
	});

	this.watch("vOffset", function (p_name,p_old,p_new) {
		this.label.vOffset = p_new + this.size;
		this.data.vOffset = p_new + this.size;
		return p_new;
	});

	return true;
}


